;(function() {
	
	window.GBC_JAVASCRIPT_ROOT = 'impl/';
	var BLANK = '';
	
	/*
	 * This is the root dependency, that recursively includes all the other needed dependencies
	 */
	Nokia.addModule('gbc', {
		getPath: function() { return GBC_JAVASCRIPT_ROOT + 'core.js'; },
		requires: ['template-default', 'busy', 'lightbox', 'gbc-views', 
			'gbc-services', 'gbc-location', 'gbc-utils'
		]
	});
	
	/*
	 * gbc-views is an empty dependency used to load all the resources needed by single views
	 */
	
	Nokia.addModule('gbc-views', {
		getPath: function() { return BLANK; },
		requires: [
			'home-view', 'twitter-item-view', 'results-view', 
			'news-item-view', 'weather-view', 
			'picasa-item-view', 'wikipedia-item-view'
		]
	});
	
	/*
	 * The following block defines the dependencies needed by each single GBC's view
	 */
	
	Nokia.addModule('home-view', {
		getPath: function() { return GBC_JAVASCRIPT_ROOT + 'views/HomeView.js'; },
		requires: ['button', 'tooltip', 'optiongroup', 'radiobox', 'textlabel']
	});
	Nokia.addModule('results-view', {
		getPath: function() { return GBC_JAVASCRIPT_ROOT + 'views/ResultsView.js'; },
		requires: ['dropdown', 'carousel']
	});
	Nokia.addModule('weather-view', {
		getPath: function() { return GBC_JAVASCRIPT_ROOT + 'views/WeatherView.js'; },
		requires: ['dropdown']
	});
	Nokia.addModule('twitter-item-view', {
		getPath: function() { return GBC_JAVASCRIPT_ROOT + 'views/TwitterItemView.js'; },
		requires: []
	});
	Nokia.addModule('news-item-view', {
		getPath: function() { return GBC_JAVASCRIPT_ROOT + 'views/NewsItemView.js'; },
		requires: ['button', 'textlabel']
	});
	Nokia.addModule('picasa-item-view', {
		getPath: function() { return GBC_JAVASCRIPT_ROOT + 'views/PicasaItemView.js'; },
		requires: ['button', 'textlabel', 'imagedescription']
	});
	Nokia.addModule('wikipedia-item-view', {
		getPath: function() { return GBC_JAVASCRIPT_ROOT + 'views/WikipediaItemView.js'; },
		requires: ['button', 'textlabel', 'imagedescription']
	});
	
	
	/*
	 * Dependency needed to interact with Web services
	 */
	Nokia.addModule('gbc-services', {
		getPath: function() { return GBC_JAVASCRIPT_ROOT + 'core-services.js'; },
		requires: []
	});
	
	/*
	 * Dependency needed to use location-based services
	 */
	Nokia.addModule('gbc-location', {
		getPath: function() { return GBC_JAVASCRIPT_ROOT + 'core-location.js'; },
		requires: []
	});
	
	/*
	 * Including a library that defines some utility methods
	 */
	Nokia.addModule('gbc-utils', {
		getPath: function() { return GBC_JAVASCRIPT_ROOT + 'core-utils.js'; },
		requires: []
	});
})();